<?php
    if (!empty($_POST)) {
        $dsn = 'mysql:dbname=yysh1807;host=127.0.0.1';
        $usr = 'root';
        $pwd = '123456';
        $pdo = new PDO($dsn , $usr , $pwd);

        $username =$_POST['username'];
//        $sql = "SELECT * FROM `yysh_admin` WHERE `username` =  ? and `id` > ?";
        $sql = "INSERT INTO `yysh_admin` (`username` , `pwd`) VALUE (?,?)";
        // 预处理sql
        $res = $pdo->prepare($sql);
        $res->execute([$username , md5('123456') ]);

//        $res = $pdo->query($sql);
//        $info  = $res->fetch(PDO::FETCH_ASSOC);
    }
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form action="?" method="post">
    <input type="text" name="username">
</form>
</body>
</html>